<?php


class DbTable_RedeMercado extends Zend_Db_Table_Abstract
{
    protected $_name = 't_rede_mercado';
    protected $_rowClass = 'RedeMercado';
    protected $_primary = 'id_rede_mercado';
    
    protected $_dependentTables = array('DbTable_Mercado');
    
    
    public static function hasRede($nomeRede){
    	$tRede = new DbTable_RedeMercado();
    	
    	$redes = $tRede->fetchAll(array('nm_rede_mercado = (?)' => strtoupper($nomeRede)));
    	
    	if (count($redes) > 0){
    		return $redes->current()->id_rede_mercado;
    	}else{
    		return false;
    	}
    }
}